/**
 * 
 */
package com.wolfpire.info.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.wolfpire.info.dao.TeaSciResearchInfoDao;
import com.wolfpire.info.model.TeaSciResearchInfo;
import com.wolfpire.info.service.TeaSciResearchInfoService;
import com.wolfpire.system.common.Constants;
import com.wolfpire.system.common.Page;
import com.wolfpire.system.common.base.dao.IBaseHibernateDao;
import com.wolfpire.system.common.base.service.impl.BaseHibernateService;

/**
 * @author lihd
 *
 */

@Service("teaSciResearchInfoService")
public class TeaSciResearchInfoServiceImpl extends
		BaseHibernateService<TeaSciResearchInfo, Long> implements
		TeaSciResearchInfoService {

	@Override
	public List<TeaSciResearchInfo> list(TeaSciResearchInfo teaSciResearchInfo) {
		return this.teaSciResearchInfoDao.list(teaSciResearchInfo);
	}

	@Override
	public void del(Long id) {
		TeaSciResearchInfo teaSciResearchInfo = this.teaSciResearchInfoDao.get(id);
		if (null != teaSciResearchInfo) {
			teaSciResearchInfo.setDelFlag(Constants.DELETE_FLAG);
			this.teaSciResearchInfoDao.saveOrUpdate(teaSciResearchInfo);
		}
	}

	@Override
	public Page<TeaSciResearchInfo> setPageDataList(
			Page<TeaSciResearchInfo> page,
			TeaSciResearchInfo filterTeaSciResearchInfo) {
		return this.teaSciResearchInfoDao.findTeaSciResearchInfos(page, filterTeaSciResearchInfo);
	}

	@Override
	protected IBaseHibernateDao<TeaSciResearchInfo, Long> getEntityDao() {
		return this.teaSciResearchInfoDao;
	}
	
	@Resource private TeaSciResearchInfoDao teaSciResearchInfoDao;
}
